package com.jing21.learn.basic.api.user.controller;

import com.jing21.learn.common.learn.ApiResult;
import com.jing21.learn.intf.entity.LearnUser;
import com.jing21.learn.intf.feignclients.UserClient;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by 郑靖 on 2017/9/15.
 */
@RestController
@Api(description = "用户信息", value = "用户信息")
public class UserController {
    @Autowired
    UserClient userClient;

    @GetMapping("/user")
    public ApiResult<LearnUser> user(@RequestParam("username") String userName) {

        return ApiResult.getResult(userClient.findByLogin(userName));
    }

}
